<template>
  <div class="changeTheme">
    <van-button  @click="changeTheme('')">默认</van-button>
    <van-button @click="changeTheme('red')">红色</van-button>
    <van-button  @click="changeTheme('green')">绿色</van-button>

  </div>
</template>

<script>
import { SET_THEME } from '@/store/modules/app'
export default {
  name: 'changeTheme',
  data () {
    return {}
  },
  methods: {
    changeTheme (theme) {
      this.$store.dispatch(SET_THEME, theme).then(res => {
        this.$toast.success(`切换${res}主题成功`)
      })
    }
  }
}
</script>

<style lang="less" scoped>
  .changeTheme {

  }
</style>
